<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageContent">
	<form method="post" action="${pageContext.request.contextPath}${requestScope.record ==null ?'/bulletin/bulletin/insert' :'/bulletin/bulletin/update' }" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
		<div class="pageFormContent" layoutH="56">
			<!-- 关闭窗口 -->
			<input type="hidden" name="callbackType" value="closeCurrent" />
			<!-- 隐藏表单 -->
			<c:if test="${requestScope.record !=null}">
				<input type="hidden" name="id" value="${requestScope.record.id}" />
			</c:if>
			<%-- <p class="nowrap">
				<label>标题</label>
				<textarea rows="4" cols="25" name="title" maxlength="999" class="required" placeholder="请输入标题">${requestScope.record.title}</textarea>
			</p> --%>
			<p class="nowrap">
				<label>标题</label> <input name="title" class="required" maxlength="999" type="text" value="${requestScope.record.title}" />
			</p>
			<%-- <p class="nowrap">
				<label>发布人ID</label> <select name="employeeId" class="combox required">
					<c:if test="${requestScope.employeeName==null}">
						<option value="all">请选择</option>
					</c:if>
					<c:forEach items="${requestScope.merchantEmployees }" var="em">
						<option value="${em.employeeId }" ${em.employeeId == requestScope.record.employeeId ? 'selected':'' }>${em.employeeName}</option>
					</c:forEach>
				</select>
			</p> --%>
			<%-- <p class="nowrap">
				<label>发布时间</label> <input type="text" name="releaseTime" class="date required" readonly="true" value="<fmt:formatDate value="${record.releaseTime}" pattern="yyyy-MM-dd" />" /><a class="inputDateButton" href="javascript:;">选择</a>
			</p> --%>
			<p class="nowrap">
				<label>内容</label> <input name="content" type="hidden" value="" />
			</p>
			<div id="div1"></div>
		</div>
		<div class="formBar">
			<ul>
				<li><div class="buttonActive">
						<div class="buttonContent">
							<button id="btn2" type="submit">保存</button>
						</div>
					</div></li>
				<li>
					<div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div>
				</li>
			</ul>
		</div>
	</form>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/statics/wangEditor-3.1.1/release/wangEditor.min.js"></script>
<script type="text/javascript">
	var E = window.wangEditor
	var editor = new E('#div1')
	editor.customConfig.uploadImgShowBase64 = true // 使用 base64 保存图片
	editor.create();
	editor.txt.html('${requestScope.record.content}');
	document.getElementById('btn2').addEventListener('click', function() {
		$("[name='content']").val(editor.txt.html());
	}, false)
</script>
